function formatDate(date, format = 'yyyy-MM-dd hh:mm:ss') {
  console.log('传入的参数', date, format);
  let now = new Date();
  now = date;
  // 获取年月日时分秒的信息
  let yyyy = now.getFullYear();
  let MM = now.getMonth() + 1;
  let dd = now.getDate();
  let hh = now.getHours();
  let mm = now.getMinutes();
  let ss = now.getSeconds();
  //替换格式字符串成为真正的时间值
  let result = format.replace(/yyyy/g, yyyy);
  result = result.replace(/MM/g, MM);
  result = result.replace(/dd/g, dd);
  result = result.replace(/hh/g, hh);
  result = result.replace(/mm/g, mm);
  result = result.replace(/ss/g, ss);

  return result;
}

// 导出
export { formatDate as formatDate };
